import request from '@/utils/request'

// 创建仓库
export function createStore(data) {
  return request({
    url: '/ems/store/create',
    method: 'post',
    data: data
  })
}

// 更新仓库
export function updateStore(data) {
  return request({
    url: '/ems/store/update',
    method: 'put',
    data: data
  })
}

// 删除仓库
export function deleteStore(id) {
  return request({
    url: '/ems/store/delete?id=' + id,
    method: 'delete'
  })
}

// 获得仓库
export function getStore(id) {
  return request({
    url: '/ems/store/get?id=' + id,
    method: 'get'
  })
}

// 获得仓库分页
export function getStorePage(query) {
  return request({
    url: '/ems/store/page',
    method: 'get',
    params: query
  })
}

// 导出仓库 Excel
export function exportStoreExcel(query) {
  return request({
    url: '/ems/store/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 查询仓库列表
export function listStore(query) {
  return request({
    url: '/ems/store/list',
    method: 'get',
    params: query
  })
}
// 获取精简信息列表
export function listSimpleStores() {
  return request({
    url: 'ems/store/list-all-simple',
    method: 'get'
  })
}
